<script>
	import { isLoggedIn } from './utils/auth.js'
	
	export default {
		globalData: {
			username: '智能维护系统'
		},
		onLaunch() {
			console.log('智能维护系统小程序启动');
			this.checkLoginStatus();
		},
		methods: {
			// 检查登录状态
			checkLoginStatus() {
				// 如果未登录，跳转到登录页
				if (!isLoggedIn()) {
					uni.reLaunch({
						url: '/pages/login/login-new'
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	// 暂时注释掉uview-ui样式
	// @import "uview-ui/index.scss";
	// @import "common/demo.scss";

	page {
		background: #f5f5f7;
		font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
	}
	
	.bgwhite{
		background: #fff;
	}

	.flex-center {
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.flex-between{
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	
	.flex-start{
		display: flex;
		justify-content: flex-start;
	}
	
	.items-center{
		align-items: center;
	}
	
	.flex-end{
		display: flex;
		justify-content: flex-end;
	}
	
	.mt20{
		margin-top: 20rpx !important;
	}
	
	.radius20{
		border-radius: 20rpx;
	}
	
	.w98 {
		width: 98%;
		margin: 0 auto;
	}

	.w96 {
		width: 96%;
		margin: 0 auto;
	}
	
	.w94 {
		width: 94%;
		margin: 0 auto;
	}
</style>
